﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonData.Data
{
    public class DataList
    {
        private static List<char> _AllCharacterList = null;
        /// <summary>
        /// 包含数字和字母的列表
        /// </summary>
        public static List<char> AllCharacterList
        {
            get
            {
                if (_AllCharacterList == null)
                {
                    _AllCharacterList = NumAndGrapList.Union(SymbolList).ToList();
                }
                return _AllCharacterList;
            }
        }
        private static List<char> _NumAndGrapList = null;
        /// <summary>
        /// 包含数字和字母的列表
        /// </summary>
        public static List<char> NumAndGrapList
        {
            get
            {
                if (_NumAndGrapList == null)
                {
                    _NumAndGrapList = NumberList.Select(s => (char)s).Union(GraphemeList).ToList();
                }
                return _NumAndGrapList;
            }
        }

        private static List<int> _NumberList = null;
        /// <summary>
        /// 数字列表
        /// </summary>
        public static List<int> NumberList
        {
            get
            {
                if (_NumberList == null)
                    _NumberList = new List<int>() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
                return _NumberList;
            }
        }


        private static List<char> _SmallGraphemeList = null;
        private static List<char> _BigGraphemeList = null;
        private static List<char> _GraphemeList = null;
        /// <summary>
        /// 小写字母列表
        /// </summary>
        public static List<char> SmallGraphemeList
        {
            get
            {
                if (_SmallGraphemeList == null)
                    _SmallGraphemeList = new List<char>() { 'a', 'b', 'c', 'd', 'e', 'f', 'g',
                        'h', 'i', 'j','k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
                return _SmallGraphemeList;
            }
        }
        /// <summary>
        /// 大写字母列表
        /// </summary>
        public static List<char> BigGraphemeList
        {
            get
            {
                if (_BigGraphemeList == null)
                    _BigGraphemeList = new List<char>() { 'A', 'B', 'C', 'D', 'E', 'F', 'G',
                        'H', 'I', 'J', 'K', 'L', 'M', 'N','O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
                return _BigGraphemeList;
            }
        }
        /// <summary>
        /// 大小写字母列表
        /// </summary>
        public static List<char> GraphemeList
        {
            get
            {
                if (_GraphemeList == null)
                    _GraphemeList = SmallGraphemeList.Union(BigGraphemeList).ToList();

                return _GraphemeList;
            }
        }


        private static List<char> _SymbolList = null;
        /// <summary>
        /// 符号列表（半角）
        /// </summary>
        public static List<char> SymbolList
        {
            get
            {
                if (_SymbolList == null)
                    _SymbolList = new List<char>() { '`', '~', '!', '@', '#', '$', '%', '^', '&', '*', ',', '.', '/', ';', '\'', '<', '>', '?', '"' };
                return _SymbolList;
            }
        }
    }
}
